<!--
    JBoss, Home of Professional Open Source
    Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual
    contributors by the @authors tag. See the copyright.txt in the
    distribution for a full listing of individual contributors.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<!-- The main page for our app, defines a simple form to allow us to set
     text that can be accessed in the other application -->

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>inter-app-B</title>
<ui:insert name="head" />
</head>

<body>

	<div id="container">
		<div id="header"></div>

		<div id="sidebar"></div>

		<div id="content">
			<h:messages />
			<!-- Set a message on the bean in the other application -->
			<h:form id="form">
				<h:panelGrid columns="3">
					<h:outputLabel for="input">Enter message "foo":</h:outputLabel>
					<h:inputText id="input" value="#{controllerB.foo}" />
					<h:message for="input" />
				</h:panelGrid>
				<h:commandButton id="send" value="Send and Update!"
					action="#{controllerB.sendAndUpdate}" />
			</h:form>
			
			<!-- See the message set on the bean in this application -->
			Message "bar": <h:outputText value="#{controllerB.bar}"
				rendered="#{not empty controllerB.bar}" />
		</div>

		<br style="clear: both" />
	</div>

</body>
</html>
